package com.pw.tool.patterns.methodpattern;

public class FactoryMethodDemo {
    public static void main(String[] args) {
        // 使用具体工厂1创建产品
        Creator creator1 = new ConcreteCreatorA();
        Product productA = creator1.factoryMethod();
        productA.use();

        // 使用具体工厂2创建产品
        Creator creator2 = new ConcreteCreatorB();
        Product productB = creator2.factoryMethod();
        productB.use();
    }
}
